const http = require("http");
const url = require("url");

var reqUrl = "http://localhost:8080";
var options = url.parse(reqUrl);

options.method = "POST";
var user = {
    userName: "zhangsan",
    age: 20,
    sex: "male",
};
var useStr = JSON.stringify(user);
var request = http.request(options, (res) => {
    res.pipe(process.stdout);
});
request.write(useStr);
request.end();
